package handler

import (
	"GetMailCode/untils"
	"context"
	_ "github.com/micro/go-micro/util/log"

	getMailCode "GetMailCode/proto/getMailCode"
)

type GetMailCode struct{}

// Call is a single request handler called via client.Call or the generated client code
func (e *GetMailCode) Call(ctx context.Context, req *getMailCode.Request, rsp *getMailCode.Response) error {
	code := untils.SendCodeEmail(req.Phone, int(req.Len))
	rsp.MailCode = code
	return nil
}
